package com.ruoyi.project.kafka;

import org.apache.flink.api.common.serialization.SimpleStringSchema;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Properties;

public class KafkaStringCosumer {

    public static void main(String[] args) throws Exception {

        /*//创建执行环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        Properties props = new Properties();
        // 指定kafka的主机地址和端口号
        props.setProperty("bootstrap.servers", "192.168.33.207:9092");
        props.setProperty("group.id", "flink-group");

        props.setProperty("auto.offset.reset", "latest");

        FlinkKafkaConsumer010<String> consumer =
                new FlinkKafkaConsumer010<>("flink-topic", new SimpleStringSchema(), props);

        DataStream<String> dataStream = env.addSource(consumer);

        dataStream.print();

        env.execute();*/
    }
}
